/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.cn.webrx.entit;

import lombok.Data;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.*;
import java.time.LocalDate;

/**
 * <p>Project: mybatis2021 - Book
 * <p>Powered by webrx On 2021-07-15 14:48:23
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 15
 */

@Data
@Table(name = "t_book") //表名为t_book 实体类名为 Book
public class Book {
    @Id
    @GeneratedValue(generator = "JDBC")
    private Integer id;
    //数据库表字段名为book_name 实体类属性名为name
    @Column(name="name")
    private String name;
    private Double price;
    private LocalDate publish;
    //不是表中字段的属性必须加 @Transient 注解
    @Transient
    private String info;

    public Book(Integer id) {
        this.id = id;
    }

    public Book() {

    }
}
